﻿using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Utilities;
using Expect.VisualStudio.Extensions;

namespace Expect.Vs2010.Extensions.Tagging
{    
    [Export(typeof(ITaggerProvider))]
    [ContentType(Constants.ExpectContentType)]
    [TagType(typeof(IFixtureTag))]
    sealed class FixtureTaggerProvider : ITaggerProvider
    {
        [Import]
        IBufferTagAggregatorFactoryService AggregatorFactory = null;

        //[Import]
        //ISpellingDictionaryService SpellingDictionary = null;

        public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
        {
            return buffer.Properties.GetOrCreateSingletonProperty(
                () => new FixtureTagger(buffer) as ITagger<T>);
        }
    }
}
